kas-text 0.4.3

Text layout and font management
Documentation

KAS Text

kas Docs

A rich-text processing library suitable for KAS and other GUI tools.

What it does (or may in the future) do:

  • Provides a representation for rich-text
  • Font discovery (very limited; system configuration is ignored)
  • Font fallback for missing glyphs (performance issues)
  • Emoticons (not really planned)
  • Transforms input text to a sequence of positioned glyphs
  • Performs line-wrapping and alignment
  • Supports bi-directional text
  • Vertical text (not planned)
  • Supports font shaping via HarfBuzz (optional: shaping feature; requires HarfBuzz library)
  • Simple integrated "shaper" supporting kerning
  • Handle combining diacritics correctly
  • Provides helpers for text editing / navigation
  • Visual-order BIDI text navigation
  • Sub-ligature navigation
  • Fast line-wrapping when only width changes
  • Scale well to large documents
  • Raster glyphs

What it does not do:

  • Draw text. This may or may not be done via a GPU, and is beyond the scope of this library
  • Directly handle text editing — this is mostly about handling input, however this library does provide helper methods for navigating prepared text

For more, see the initial design document and issue #1.

Examples

Since kas-text only concerns text-layout, all examples here are courtesy of KAS GUI. See the examples directory.

BIDI layout and editing Markdown

Contributing

Contributions are welcome. For the less straightforward contributions it is advisable to discuss in an issue before creating a pull-request.

Testing is currently done in a very ad-hoc manner via KAS examples. This is facilitated by tying KAS commits to kas-text commit hashes during development and allows testing editing as well as display. A comprehensive test framework must consider a huge number of cases and the test framework alone would constitute considerably more work than building this library, so for now user-testing and bug reports will have to suffice.

Copyright and License

The COPYRIGHT file includes a list of contributors who claim copyright on this project. This list may be incomplete; new contributors may optionally add themselves to this list.

The KAS library is published under the terms of the Apache License, Version 2.0. You may obtain a copy of this license from the LICENSE file or on the following web page: https://www.apache.org/licenses/LICENSE-2.0